<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{:__('订单信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单ID:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.id|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单编号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.order_no|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('下单用户:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.userData.mobile ?? '已删除'}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.statusText|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('更新时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.updated_at|datetime|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('下单时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.created_at|datetime|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('所在门店:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.shopData.name|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('就餐方式:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.enjoyTypeText|htmlentities}</p>
                </div>
                {if condition="$row.enjoy_type == 'pack'"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('预留电话:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.contact|htmlentities}</p>
                </div>
                {/if}
                {if condition="$row.enjoy_type == 'meat'"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('桌位号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.deskData.number|htmlentities}</p>
                </div>
                {/if}
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('打印状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.printStatusText|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('打印时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{php}echo $row['print_time'] ? date('Y-m-d H:i:s', $row['print_time']) : '--';{/php}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('打印次数:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.print_times|htmlentities}</p>
                </div>
            </div>
        </form>
    </div>
    <div class="panel-heading">
        <h3 class="panel-title">{:__('商品信息')}</h3>
    </div>
    <div class="panel-body">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>{:__('子订单编号')}</th>
                <th>{:__('ID')}</th>
                <th>{:__('名称')}</th>
<!--                <th>{:__('商品类型')}</th>-->
                <th>{:__('价格')}</th>
                <th>{:__('封面')}</th>
                <th>{:__('数量')}</th>
                <th>{:__('其他信息')}</th>
                <th>{:__('应付金额')}</th>
                <th>{:__('余额支付')}</th>
                <th>{:__('现金支付')}</th>
                <th>{:__('退款单号')}</th>
                <th>{:__('退款状态')}</th>
            </tr>
            </thead>
            <tbody>
            {volist name="row.orderItemListData" id="vo"}
            <tr>
                <td>{$vo.order_item_no|htmlentities}</td>
                <td>{$vo.goods_id|htmlentities}</td>
                <td>{$vo.goods_name|htmlentities}</td>
<!--                <td>{$vo.goods_type_text|htmlentities}</td>-->
                <td>{$vo.goods_price|htmlentities}</td>
                <td><img src="{$vo.goods_cover|htmlentities}" alt="" style="max-height: 80px;"></td>
                <td>{$vo.goods_count|htmlentities}</td>
                <td>{$vo.goodsNames|htmlentities}</td>
                <td>{$vo.payment|htmlentities}</td>
                <td>{$vo.balance|htmlentities}</td>
                <td>{$vo.payment_rel|htmlentities}</td>
                <td>{$vo.refund_no|htmlentities}</td>
                <td>{$vo.refund_status_text|htmlentities}</td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('订单备注:')}</label>
                <div class="col-xs-12 col-sm-8">
                    <p class="form-control-static">{$row.note|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('商品总价:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.total_price|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('优惠金额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.discount|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('应付金额:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment|htmlentities}</p>
                </div>
            </div>
        </form>
    </div>
    <div class="panel-heading">
        <h3 class="panel-title">{:__('支付信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('余额支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.balance|htmlentities}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('现金支付:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment_rel|htmlentities}</p>
                </div>
                {if condition="$row.payment_no"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('支付单号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment_no|htmlentities}</p>
                </div>
                {/if}
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('支付状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment_status_text|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('支付方式:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment_name|htmlentities}</p>
                </div>
                <label class="col-xs-12 col-sm-1 control-label">{:__('支付时间:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.payment_time|datetime|htmlentities}</p>
                </div>
            </div>
        </form>
    </div>
    <div class="panel-heading">
        <h3 class="panel-title">{:__('退款信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('退款状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refundStatusText|htmlentities}</p>
                </div>
                {if condition="$row.refund_no"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('退款单号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.refund_no|htmlentities}</p>
                </div>
                {/if}
            </div>
        </form>
    </div>
    <div class="panel-heading">
        <h3 class="panel-title">{:__('开票信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-1 control-label">{:__('开票状态:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.invoiceStatusText|htmlentities}</p>
                </div>
                {if condition="$row.invoice_no"}
                <label class="col-xs-12 col-sm-1 control-label">{:__('开票单号:')}</label>
                <div class="col-xs-12 col-sm-2">
                    <p class="form-control-static">{$row.invoice_no|htmlentities}</p>
                </div>
                {/if}
            </div>
        </form>
    </div>
    <div class="panel-footer">
        <div class="action-box">
            {if condition="$row.status == 1"}
            <a class="btn btn-primary change-price {:$auth->check('yunfood/order/main/change')?'':'hide'}" href="javascript:" data-id="{$row.id|htmlentities}">{:__('修改价格')}</a>
            <a class="btn btn-warning cancel-order {:$auth->check('yunfood/order/main/manualCancel')?'':'hide'}" href="javascript:" data-id="{$row.id|htmlentities}">{:__('取消订单')}</a>
            <a class="btn btn-danger mark-payed {:$auth->check('yunfood/order/main/markPayed')?'':'hide'}" href="javascript:" data-id="{$row.id|htmlentities}">{:__('标记已支付')}</a>
            <a class="btn btn-danger mark-finish {:$auth->check('yunfood/order/main/markFinish')?'':'hide'}" href="javascript:" data-id="{$row.id|htmlentities}">{:__('标记已完成')}</a>
            {/if}
            <a class="btn btn-danger print-order {:$auth->check('yunfood/order/main/print')?'':'hide'}" href="javascript:" data-id="{$row.id|htmlentities}">{:__('打印小票')}</a>
        </div>
    </div>
</div>
<div class="btn-refresh hide"></div>

<style>
    .control-label {
        width: 120px;
    }

    .panel {
        margin-bottom: 50px;
    }
    .panel-footer {
        width: 100%;
        position: fixed;
        left: 0;
        bottom: 0;
    }
    .action-box {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .action-box .btn {
        margin: 0 20px;
    }
</style>